
import java.util.Scanner;
import java.util.stream.Collectors;

public class java7 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        String input = scanner.nextLine();
        String target = scanner.nextLine();

        StringBuilder inputBuilder = new StringBuilder(input);
        boolean found = true;

        found = target.chars()
                .mapToObj(c -> (char) c)
                .allMatch(c -> {
                    int index = inputBuilder.indexOf(String.valueOf(c));
                    if (index!= -1) {
                        inputBuilder.deleteCharAt(index);
                        return true;
                    }
                    return false;
                });

        if (found) {
            System.out.println("Yes " + inputBuilder.toString());
        } else {
            System.out.println("No");
        }
    }
}